package com.itouchtv.yang.cucumber;

import com.itouchtv.yang.core.driver.BaseDriver;
import com.itouchtv.yang.core.driver.CommDriver;
import com.itouchtv.yang.core.tools.Log;
import cucumber.api.CucumberOptions;
import cucumber.api.testng.AbstractTestNGCucumberTests;
import org.testng.annotations.*;

@CucumberOptions(plugin = {"json:target/cucumber2.json", "pretty"},
        features = "src\\test\\resources\\feature\\",
        glue = "com.itouchtv.yang.library.page")
public class CucumberRun extends AbstractTestNGCucumberTests {

    @BeforeMethod
    protected void launchBrowser() {
        BaseDriver driver = new BaseDriver();
        CommDriver.driver.set(driver);
    }

    @AfterMethod
    protected void closeBrowser() {
        Log.logger.info("退出浏览器");
        CommDriver.driver.get().closeBrowser();
    }

    @AfterSuite
    protected void endTest() {
        Log.logger.info("测试结束");
    }
}
